package com.mystudy.management.usermanagement.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


//只负责视图跳转的类
@Controller
@RequestMapping("/admin/index")
public class IndexMainController {
/*
--------------------------------------------------授权管理页-------------------------------------
 */
    //匹配访问首页的路径
    @RequestMapping(value={""})
    public String toIndex(Model model){
        model.addAttribute("title","管理端-授权管理-授权用户");
        return "index";
    }

    //导航：授权用户，左导航，授权管理
    @RequestMapping(value = {"/authorize","/"})
    public String toAuthorize(Model model){
        model.addAttribute("title","管理端-授权管理-授权用户");
        return "redirect:/admin/index";//使用重定向，以免视图解析次数过多造成请求路径紊乱
    }





/*
---------------------------------------------------访问监管页----------------------------------------------
 */

    //匹配访问监管的访问记录页面
    @RequestMapping(value ={"/supervision","/supervision/log"})
    public String toSupervision(Model model){
        model.addAttribute("title","管理端-访问监管-访问记录");
        return "index2_1";
    }

    //匹配访问控制界面
    @RequestMapping("/supervision/control")
    public String toControl(Model model){
        model.addAttribute("title","管理端-访问监管-访问控制");
        return "index2_2";
    }

    //匹配流量监控界面
    @RequestMapping("/supervision/float")
    public String toFloat(Model model){
        model.addAttribute("title","管理端-访问监管-流量监控");
        return "index2_3";
    }
}
